package ${package};

<#if tableClass.allFields??>
    <#list tableClass.allFields as field>
    <#if field.typePackage != "java.lang"  && field.typePackage != tableClass.packageName >
import ${field.fullTypeName};
    </#if>
    </#list>
</#if>
<#if lombok??>
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
</#if>

<#assign dateTime = .now>
/**
* 通用 Mapper 代码生成器生成 Model
*
* @author Stream  ${dateTime?string["yyyy-MM-dd HH:mm:ss"]}
*/

<#if lombok??>
@Setter
@Getter
@ToString
</#if>
<#if  tableClass.shortClassName != tableClass.tableName >
@Table(name = "<#if beginningDelimiter??>${beginningDelimiter}</#if>${tableClass.tableName}<#if endingDelimiter??>${endingDelimiter}</#if>")
</#if>
public class ${tableClass.shortClassName} extends ${rootClass} {

<#if tableClass.pkFields??>

    <#list tableClass.pkFields as field>
    @Id
    <#if field.columnName != field.fieldName >
    @Column(name = "${field.columnName}")
    </#if>
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private ${field.shortTypeName} ${field.fieldName};
    </#list>
</#if>

<#if tableClass.baseFields??>
    <#list tableClass.baseFields as field>
    /**
    * ${field.remarks}
    */
    <#if field.columnName != field.fieldName >
    @Column(name = "${field.columnName}")
    </#if>
    private ${field.shortTypeName} ${field.fieldName};

    </#list>
</#if>

}

